<!DOCTYPE html>
<html>
<head>
  <title>汽车列表</title>
</head>
<body>
<a href="admin.php?c=carbrand&m=listcarbrand">品牌列表</a>
<a href="admin.php?c=cartype&m=listcartype">类型列表</a>
<a href="admin.php?c=carphoto&m=carphotoform">添加汽车</a>
<h1><center>汽车列表</center></h1>
 <table align="center" border="1"> 
 <tr>
  <th>汽车ID</th>
  <th>汽车品牌</th>
  <th>汽车类型</th>
  <th>汽车名</th>
  <th>汽车简介</th>                                                         
  <th>添加日期</th>
 </tr>

<?php
  define('UserPhotoPath','images/');
  static $count=0;
  foreach($data as $one){
    $count++;
    echo '<td>'.$one['cid'].'</td>';
    if($one['bid']==1){
      echo '<td>宝马</td>';
    } else if($one['bid']==2){
      echo '<td>奥迪</td>';
    } else if($one['bid']==3){
      echo '<td>丰田</td>';
    }
    if($one['tid']==1){
      echo '<td>越野</td>';
    } else if($one['tid']==2){
      echo '<td>超跑</td>';
    } else if($one['tid']==3){
      echo '<td>轿车</td>';
    }
   echo '<td>'.$one['carname'].'</td>';
   
    echo '<td>'.$one['intro'].'</td>';
    echo '<td>'.$one['uploaddate'].'</td>';
     echo '<td align="center">
        <img src='.UserPhotoPath.$one['pic'].' width=100 height=120 alt="无图片"></td>';
    echo '<td>
    <a href="admin.php?c=carphoto&m=carphotoedit&id='.$one['cid'].' ">修改</a>| 
    <a href="admin.php?c=carphoto&m=delcarphoto&id='.$one['cid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a>
     </td>';
    echo '</tr>';  
  }
  echo '</table>';  
  echo "<table align='center'><tr><td>共有 {$count} 名用户</td></tr></table>";   
 ?>
 </body>
</html>